fix(archive): kill stalled hsi/htar subprocess calls instead of hanging #32
+625
−113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
subprocess.run()call tohsi/htar/htar_large/tarinarchive.pyhad notimeout=- a hung HPSS connection would block until Slurm's own wall-clock limit (up to 48h). Confirmed on Negishi job 40793013 (repository_X1D_3_metabolomics_rawspectra), which ran 32h+ before manual cancellation; its.outfile showed the destinationhsi mkdirline and then nothing - thehtar_largecreate call's connection stalled before transferring a byte.sacctconfirmed every other job that batch completed fine - an isolated stall, not a broader HPSS outage). The signal that distinguishes a hang from a merely-long transfer is silence, not elapsed time._run_with_stall_watch()(module-level, used directly byship_object) and a self-contained inline twinrun_watched()insidesend_to_fortress(invariant chore(reclaim): hold AAPF landing-zone raw until promote loop verified #1 - dill-safety for--globus). Both drivePopen+ a non-blocking read/poll loop, killing the process and raising a distinguishableRuntimeErrorifHTAR_STALL_SECONDS(2h) passes with no new stdout/stderr.hsi mkdir/hsi ls) get a flatHSI_SHORT_CALL_TIMEOUT_SECONDS(5 min) on plainsubprocess.run()instead, since they carry no progress signal to watch.[FAILED]email + log insend_to_fortress; propagates to the caller's[FAILED]/bell handling fromship_object, same as before). Nothing new to retry: skip-unchanged/resume already re-attempt a killed object/target cleanly.CLAUDE.md.Test plan
tests/test_stall_detection.py: direct coverage of_run_with_stall_watch()in both modes (PIPE-captured forship_object, file-growth forsend_to_fortress's twin) - steady output under the stall window completes normally, silence past the window kills the process and raises, a normal nonzero exit is unaffected, and the short-call timeout path is fail-safe.tests/test_ship_object_htar_rc.pyupdated to drive real fakehtar/htar_large/hsi/tarexecutables onPATH(exercising the actualPopen/selectplumbing) instead of mockingsubprocess.run, since the create/round-trip calls no longer call it directly.python3 -m pytest tests/ -q-> 312 passed (303 previously + 9 new).Not merging without approval per repo convention (production archive/retrieve code path).